package org.model.common.exception;

/**
 * 参数校验异常.
 *
 * @author Luo
 * @date 2023-07-17 13:31
 */

public class ParamCheckException extends RuntimeException {

    /**
     * 错误码.
     */
    private Integer code;

    /**
     * 错误提示.
     */
    private String message;

    /**
     * 空构造方法，避免反序列化问题.
     */
    public ParamCheckException() {
        this.message = "参数异常";
    }

    public ParamCheckException(String message) {
        this.message = message;
    }

    public ParamCheckException(String message, Integer code) {
        this.message = message;
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public Integer getCode() {
        return code;
    }

    public ParamCheckException setMessage(String message) {
        this.message = message;
        return this;
    }

}
